Skip to content

Refines MAUI Dialog Layout and Active State Management#3390

Merged
brianlagunas merged 4 commits intomasterfrom
popups
Mar 28, 2026
Merged

Refines MAUI Dialog Layout and Active State Management#3390
brianlagunas merged 4 commits intomasterfrom
popups

Conversation

@brianlagunas
Copy link
Copy Markdown
Member

Description of Change

This change set significantly improves the reliability and behavior of MAUI dialogs and window activation states.

The DialogContainerPage's content layout has been refactored to address issues with the dialog mask layout and tap gesture reliability across MAUI platforms. The main overlay now utilizes a Grid to ensure the mask fills the page naturally without conflicting with WidthRequest/HeightRequest bindings. A nested AbsoluteLayout is maintained specifically for the popup content, allowing existing LayoutBounds positioning to function as expected.

A race condition in the DialogService's navigation state and IActiveAware updates has been resolved. The process of setting PageNavigationService.NavigationSource and updating IsActive properties for IActiveAware views and view models now correctly defers until the modal dialog is actually displayed, preventing premature state changes.

Additionally, the IActiveAware state for the current page is now correctly updated to false when a PrismWindow is deactivated, ensuring consistent application state management.

Bugs Fixed

API Changes

None

Behavioral Changes

  • MAUI dialog masks will now size correctly and respond to tap gestures more reliably.
  • IsActive state updates for IActiveAware components during dialog presentation will be more accurate and timely.
  • The IsActive state of the current page will correctly reflect window deactivation.

Ensures that PageNavigationSource and IsActive state updates are deferred until the dialog has been pushed by using ContinueWith on the asynchronous ConfigureLayout call. This prevents state updates from executing before the modal is actually displayed.
Replaces the root AbsoluteLayout in DialogContainerPage with a Grid. This ensures the background mask fills the screen naturally without needing proportional sizing or explicit WidthRequest/HeightRequest bindings, which were causing tap gestures to fail on some MAUI platforms.
@brianlagunas brianlagunas merged commit a185bf1 into master Mar 28, 2026
5 checks passed
@brianlagunas brianlagunas deleted the popups branch March 28, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant